package com.huage_03;

public class StringBuilderDemo01 {
    public static void main(String[] args) {

        StringBuilder sb = new StringBuilder();

        //添加数据，链式编程
        sb.append("Hello").append("World").append(100);
        System.out.println("sb = " + sb);
        //StringBuilder转String
        String str = sb.toString();
        System.out.println("str = " + str);

        //String转StringBuilder
        StringBuilder sb1 = new StringBuilder(str);
        System.out.println("sb1 = " + sb1);
        //反转
        sb1.reverse();
        System.out.println("sb1 = " + sb1);
    }
}
